<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2025/2/6
  Time: 12:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>Forward</h1>
<%
    request.setAttribute("name","Tom");
//    转发是将同一个请求传给下一个页面，重定向是创建一个请求传给下一个页面
    request.getRequestDispatcher("target.jsp").forward(request,response);
//    response.sendRedirect("target.jsp");
%>
</body>
</html>
